package com.liaoban.app.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.liaoban.app.R;
import com.liaoban.app.api.type.CallHistory;
import com.liaoban.app.biz.CommonBiz;
import com.liaoban.app.helper.ImageHelper;
import com.liaoban.app.util.CommonUtils;

import java.util.List;

/**
 * 通话记录
 */
public class CallHistoryAdapter extends BaseQuickAdapter<CallHistory, BaseViewHolder> {

    public CallHistoryAdapter(@Nullable List<CallHistory> data) {
        super(R.layout.item_call_history, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, CallHistory item) {
        ImageView ivSrc = helper.getView(R.id.iv_src);
        ImageHelper.load(ivSrc, CommonUtils.getFullPic(item.getWuserSrc()));
        helper.setText(R.id.tv_name, item.getWuserName());
        helper.setText(R.id.tv_call_jtime, item.getCallJTime());
        helper.setText(R.id.tv_call_time, item.getCallTime());
    }
}
